'use strict';
var fs = require('fs');
//"sequelize": "^4.37.3",
var Sequelize = require('sequelize');

CONFIG={
	"mysql_host": "localhost",
	"mysql_user": "root",
	"mysql_database": "api",
	"mysql_password": "123456",
}

console.log("connect to mysql:"+CONFIG.mysql_host)

exports.sequelize = function () {
	var config = CONFIG;
	return new Sequelize(
		config.mysql_database,
		config.mysql_user, 
		config.mysql_password, 
		{
			dialect: 'mysql',
			host: config.mysql_host,
			port:3306, 
			pool: {
				max: 100,
				min: 0,
				acquire: 30000,
				idle: 10000,
			},
			logging:false,
			// logging:console.log,
			timezone: '+08:00' //东八时区
		}
	);
}